package org.spiderflow.mongodb.service;

import java.io.InputStream;
import java.util.List;
import java.util.Optional;
import org.spiderflow.mongodb.model.FileDocument;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 双鱼冲
 * @ClassName:IFileService
 * @Description: (这里用一句话描述这个接口的作用)
 * @date 2020-11-14
 * @since 1.0
 */
public interface IFileService {

  FileDocument saveFile(String alias, String md5, MultipartFile file);

  void removeFile(String alias, String id, boolean isDeleteFile);

  String uploadFileToGridFS(String alias, InputStream in, String contentType);

  Optional<FileDocument> getFileById(String alias, String id);

  FileDocument getByMd5(String alias, String md5);

  List<FileDocument> listFilesByPage(String alias, int pageIndex, int pageSize);

}
